package com.zmx.user.entity;

import com.zmx.common.common.entitys.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.Where;

/**
 * @author zhaomxr
 * null
 */
@Data
@Entity
@Table(name = "member_comments")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper=true)
@Inheritance(strategy = InheritanceType.JOINED)
@Where(clause = "dr = 0 and is_vaild = 1")
public class MemberComments extends BaseEntity {

	/**
	 * 用户id
	 */
	@Column(name = "member_id")
	private Long memberId;

	/**
	 * 用户名称
	 */
	@Column(name = "member_name")
	private Long memberName;

	/**
	 * 商品id
	 */
	@Column(name = "product_id")
	private Long productId;

	/**
	 * 星级 1.一星 2.二星  依次类推
	 */
	@Column(name = "star_level")
	private Integer starLevel;

	/**
	 * null
	 */
	@Column(name = "comments")
	private String comments;

	/**
	 * 是否匿名评论
	 */
	@Column(name = "anonymous")
	private Integer anonymous;

	/**
	 * 评论图片
	 */
	@Column(name = "detail_pics")
	private String detailPics;

	/**
	 * 是否有效
	 */
	@Column(name = "is_vaild")
	private Integer isVaild;
}
